using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using C1.Win.C1TrueDBGrid;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.Common.DS;
using PCSComSale.Order.BO;
using PCSComSale.Order.DS;
using PCSComUtils.MasterSetup.DS;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;
using CancelEventArgs = System.ComponentModel.CancelEventArgs;
using PCSComUtils.DataContext;
using PCSComUtils.MasterSetup.BO;

namespace PCSSale.Order
{
	/// <summary>
	/// Summary description for SOCancelCommitment.
	/// </summary>
	public class SOCancelCommitment : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label lblLable3;
		private System.Windows.Forms.Label lblLable7;
		private System.Windows.Forms.Label lblLable12;
		private System.Windows.Forms.Label lblLable11;
		private System.Windows.Forms.Label lblLable1;
		private C1.Win.C1List.C1Combo cboCCN;
		private System.Windows.Forms.CheckBox chkSelectAll;
		private System.Windows.Forms.TextBox txtSaleOrderCode;
		private System.Windows.Forms.Button btnFindSaleOrder;
		private System.Windows.Forms.Button btnClose;
		private System.Windows.Forms.Button btnHelp;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		DataTable dtbGridLayout;

		string	CaptionLine, CaptionDelivery, CaptionMasterLocation, CaptionCommitQuantity, CaptionUnitOfMeasure, 
				CaptionLocation, CaptionBin, CaptionProductCode, CaptionProductDes, CaptionCancel;
		const string DELIVERY = "Delivery";
		const string UNITOFMEASURE = "Measure";
		const string MASTERLOCATION = "MasterLocation";
		const string LOCATION = "Location";
		const string BIN = "Bin";
		const string PRODUCTCODE = "ProductCode";
		const string PRODUCTDES = "ProductDes";
		const string CANCEL = "Cancel";
		const string TRUE = "True";

		private const string THIS = "PCSSale.Order.SOCancelCommitment";
		private bool blnStateOfCheck = false;

		public EnumAction enumAction = EnumAction.Default;
		private bool blnHasError = false;
		
		private DataSet dstCancelCommit = new DataSet();
		private System.Windows.Forms.Button btnCancelCommitment;
		private System.Windows.Forms.Button btnSearch;
		private C1.Win.C1TrueDBGrid.C1TrueDBGrid dgrdData;
		private SOCancelCommitmentBO boCancelCommitment = new SOCancelCommitmentBO();
		private System.Windows.Forms.TextBox txtBuyingLoc;
		private System.Windows.Forms.TextBox txtCustomer;
		private System.Windows.Forms.TextBox txtCustomerName;
		private System.Windows.Forms.TextBox txtQuote;
		private System.Windows.Forms.Button btnQuote;
		private System.Windows.Forms.Label lblQuote;
		private SO_SaleOrderMasterVO voSOMaster = new SO_SaleOrderMasterVO();

		public SOCancelCommitment()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SOCancelCommitment));
			this.btnClose = new System.Windows.Forms.Button();
			this.btnHelp = new System.Windows.Forms.Button();
			this.btnCancelCommitment = new System.Windows.Forms.Button();
			this.lblLable12 = new System.Windows.Forms.Label();
			this.cboCCN = new C1.Win.C1List.C1Combo();
			this.lblLable11 = new System.Windows.Forms.Label();
			this.chkSelectAll = new System.Windows.Forms.CheckBox();
			this.lblLable3 = new System.Windows.Forms.Label();
			this.txtSaleOrderCode = new System.Windows.Forms.TextBox();
			this.lblLable7 = new System.Windows.Forms.Label();
			this.dgrdData = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
			this.btnFindSaleOrder = new System.Windows.Forms.Button();
			this.lblLable1 = new System.Windows.Forms.Label();
			this.btnSearch = new System.Windows.Forms.Button();
			this.txtBuyingLoc = new System.Windows.Forms.TextBox();
			this.txtCustomer = new System.Windows.Forms.TextBox();
			this.txtCustomerName = new System.Windows.Forms.TextBox();
			this.txtQuote = new System.Windows.Forms.TextBox();
			this.btnQuote = new System.Windows.Forms.Button();
			this.lblQuote = new System.Windows.Forms.Label();
			((System.ComponentModel.ISupportInitialize)(this.cboCCN)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.dgrdData)).BeginInit();
			this.SuspendLayout();
			// 
			// btnClose
			// 
			this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
			this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
			this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
			this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
			this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
			this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
			this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
			this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
			this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
			this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
			this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
			this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
			this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
			this.btnClose.Name = "btnClose";
			this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
			this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
			this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
			this.btnClose.Text = resources.GetString("btnClose.Text");
			this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
			this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// btnHelp
			// 
			this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
			this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
			this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
			this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
			this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
			this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
			this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
			this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
			this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
			this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
			this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
			this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
			this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
			this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
			this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
			this.btnHelp.Text = resources.GetString("btnHelp.Text");
			this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
			this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
			// 
			// btnCancelCommitment
			// 
			this.btnCancelCommitment.AccessibleDescription = resources.GetString("btnCancelCommitment.AccessibleDescription");
			this.btnCancelCommitment.AccessibleName = resources.GetString("btnCancelCommitment.AccessibleName");
			this.btnCancelCommitment.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnCancelCommitment.Anchor")));
			this.btnCancelCommitment.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCancelCommitment.BackgroundImage")));
			this.btnCancelCommitment.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnCancelCommitment.Dock")));
			this.btnCancelCommitment.Enabled = ((bool)(resources.GetObject("btnCancelCommitment.Enabled")));
			this.btnCancelCommitment.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnCancelCommitment.FlatStyle")));
			this.btnCancelCommitment.Font = ((System.Drawing.Font)(resources.GetObject("btnCancelCommitment.Font")));
			this.btnCancelCommitment.Image = ((System.Drawing.Image)(resources.GetObject("btnCancelCommitment.Image")));
			this.btnCancelCommitment.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCancelCommitment.ImageAlign")));
			this.btnCancelCommitment.ImageIndex = ((int)(resources.GetObject("btnCancelCommitment.ImageIndex")));
			this.btnCancelCommitment.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnCancelCommitment.ImeMode")));
			this.btnCancelCommitment.Location = ((System.Drawing.Point)(resources.GetObject("btnCancelCommitment.Location")));
			this.btnCancelCommitment.Name = "btnCancelCommitment";
			this.btnCancelCommitment.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnCancelCommitment.RightToLeft")));
			this.btnCancelCommitment.Size = ((System.Drawing.Size)(resources.GetObject("btnCancelCommitment.Size")));
			this.btnCancelCommitment.TabIndex = ((int)(resources.GetObject("btnCancelCommitment.TabIndex")));
			this.btnCancelCommitment.Text = resources.GetString("btnCancelCommitment.Text");
			this.btnCancelCommitment.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCancelCommitment.TextAlign")));
			this.btnCancelCommitment.Visible = ((bool)(resources.GetObject("btnCancelCommitment.Visible")));
			this.btnCancelCommitment.Click += new System.EventHandler(this.btnCancelCommitment_Click);
			// 
			// lblLable12
			// 
			this.lblLable12.AccessibleDescription = resources.GetString("lblLable12.AccessibleDescription");
			this.lblLable12.AccessibleName = resources.GetString("lblLable12.AccessibleName");
			this.lblLable12.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLable12.Anchor")));
			this.lblLable12.AutoSize = ((bool)(resources.GetObject("lblLable12.AutoSize")));
			this.lblLable12.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLable12.Dock")));
			this.lblLable12.Enabled = ((bool)(resources.GetObject("lblLable12.Enabled")));
			this.lblLable12.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.lblLable12.Font = ((System.Drawing.Font)(resources.GetObject("lblLable12.Font")));
			this.lblLable12.ForeColor = System.Drawing.Color.Maroon;
			this.lblLable12.Image = ((System.Drawing.Image)(resources.GetObject("lblLable12.Image")));
			this.lblLable12.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable12.ImageAlign")));
			this.lblLable12.ImageIndex = ((int)(resources.GetObject("lblLable12.ImageIndex")));
			this.lblLable12.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLable12.ImeMode")));
			this.lblLable12.Location = ((System.Drawing.Point)(resources.GetObject("lblLable12.Location")));
			this.lblLable12.Name = "lblLable12";
			this.lblLable12.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLable12.RightToLeft")));
			this.lblLable12.Size = ((System.Drawing.Size)(resources.GetObject("lblLable12.Size")));
			this.lblLable12.TabIndex = ((int)(resources.GetObject("lblLable12.TabIndex")));
			this.lblLable12.Text = resources.GetString("lblLable12.Text");
			this.lblLable12.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable12.TextAlign")));
			this.lblLable12.Visible = ((bool)(resources.GetObject("lblLable12.Visible")));
			// 
			// cboCCN
			// 
			this.cboCCN.AccessibleDescription = resources.GetString("cboCCN.AccessibleDescription");
			this.cboCCN.AccessibleName = resources.GetString("cboCCN.AccessibleName");
			this.cboCCN.AddItemSeparator = ';';
			this.cboCCN.AllowRowSizing = C1.Win.C1List.RowSizingEnum.AllRows;
			this.cboCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cboCCN.Anchor")));
			this.cboCCN.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cboCCN.BackgroundImage")));
			this.cboCCN.Caption = "";
			this.cboCCN.CaptionHeight = 17;
			this.cboCCN.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
			this.cboCCN.ColumnCaptionHeight = 17;
			this.cboCCN.ColumnFooterHeight = 17;
			this.cboCCN.ComboStyle = C1.Win.C1List.ComboStyleEnum.DropdownList;
			this.cboCCN.ContentHeight = 15;
			this.cboCCN.DeadAreaBackColor = System.Drawing.Color.Empty;
			this.cboCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cboCCN.Dock")));
			this.cboCCN.EditorBackColor = System.Drawing.SystemColors.Window;
			this.cboCCN.EditorFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.cboCCN.EditorForeColor = System.Drawing.SystemColors.WindowText;
			this.cboCCN.EditorHeight = 15;
			this.cboCCN.Enabled = ((bool)(resources.GetObject("cboCCN.Enabled")));
			this.cboCCN.FlatStyle = C1.Win.C1List.FlatModeEnum.System;
			this.cboCCN.Font = ((System.Drawing.Font)(resources.GetObject("cboCCN.Font")));
			this.cboCCN.GapHeight = 2;
			this.cboCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cboCCN.ImeMode")));
			this.cboCCN.ItemHeight = 15;
			this.cboCCN.Location = ((System.Drawing.Point)(resources.GetObject("cboCCN.Location")));
			this.cboCCN.MatchEntryTimeout = ((long)(2000));
			this.cboCCN.MaxDropDownItems = ((short)(5));
			this.cboCCN.MaxLength = 32767;
			this.cboCCN.MouseCursor = System.Windows.Forms.Cursors.Default;
			this.cboCCN.Name = "cboCCN";
			this.cboCCN.PartialRightColumn = false;
			this.cboCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cboCCN.RightToLeft")));
			this.cboCCN.RowDivider.Color = System.Drawing.Color.DarkGray;
			this.cboCCN.RowDivider.Style = C1.Win.C1List.LineStyleEnum.None;
			this.cboCCN.RowSubDividerColor = System.Drawing.Color.DarkGray;
			this.cboCCN.Size = ((System.Drawing.Size)(resources.GetObject("cboCCN.Size")));
			this.cboCCN.TabIndex = ((int)(resources.GetObject("cboCCN.TabIndex")));
			this.cboCCN.Text = resources.GetString("cboCCN.Text");
			this.cboCCN.Visible = ((bool)(resources.GetObject("cboCCN.Visible")));
			this.cboCCN.PropBag = "<?xml version=\"1.0\"?><Blob><Styles type=\"C1.Win.C1List.Design.ContextWrapper\"><Da" +
				"ta>Group{AlignVert:Center;Border:None,,0, 0, 0, 0;BackColor:ControlDark;}Style2{" +
				"}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{ForeColor:High" +
				"lightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:InactiveCaptionText;Ba" +
				"ckColor:InactiveCaption;}Footer{}Caption{AlignHorz:Center;}Normal{BackColor:Wind" +
				"ow;}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}Style1{}OddRow{}Re" +
				"cordSelector{AlignImage:Center;}Heading{Wrap:True;BackColor:Control;Border:Raise" +
				"d,,1, 1, 1, 1;ForeColor:ControlText;AlignVert:Center;}Style8{}Style10{}Style11{}" +
				"Style9{AlignHorz:Near;}</Data></Styles><Splits><C1.Win.C1List.ListBoxView AllowC" +
				"olSelect=\"False\" Name=\"\" CaptionHeight=\"17\" ColumnCaptionHeight=\"17\" ColumnFoote" +
				"rHeight=\"17\" VerticalScrollGroup=\"1\" HorizontalScrollGroup=\"1\"><ClientRect>0, 0," +
				" 116, 156</ClientRect><VScrollBar><Width>16</Width></VScrollBar><HScrollBar><Hei" +
				"ght>16</Height></HScrollBar><CaptionStyle parent=\"Style2\" me=\"Style9\" /><EvenRow" +
				"Style parent=\"EvenRow\" me=\"Style7\" /><FooterStyle parent=\"Footer\" me=\"Style3\" />" +
				"<GroupStyle parent=\"Group\" me=\"Style11\" /><HeadingStyle parent=\"Heading\" me=\"Sty" +
				"le2\" /><HighLightRowStyle parent=\"HighlightRow\" me=\"Style6\" /><InactiveStyle par" +
				"ent=\"Inactive\" me=\"Style4\" /><OddRowStyle parent=\"OddRow\" me=\"Style8\" /><RecordS" +
				"electorStyle parent=\"RecordSelector\" me=\"Style10\" /><SelectedStyle parent=\"Selec" +
				"ted\" me=\"Style5\" /><Style parent=\"Normal\" me=\"Style1\" /></C1.Win.C1List.ListBoxV" +
				"iew></Splits><NamedStyles><Style parent=\"\" me=\"Normal\" /><Style parent=\"Normal\" " +
				"me=\"Heading\" /><Style parent=\"Heading\" me=\"Footer\" /><Style parent=\"Heading\" me=" +
				"\"Caption\" /><Style parent=\"Heading\" me=\"Inactive\" /><Style parent=\"Normal\" me=\"S" +
				"elected\" /><Style parent=\"Normal\" me=\"HighlightRow\" /><Style parent=\"Normal\" me=" +
				"\"EvenRow\" /><Style parent=\"Normal\" me=\"OddRow\" /><Style parent=\"Heading\" me=\"Rec" +
				"ordSelector\" /><Style parent=\"Caption\" me=\"Group\" /></NamedStyles><vertSplits>1<" +
				"/vertSplits><horzSplits>1</horzSplits><Layout>Modified</Layout><DefaultRecSelWid" +
				"th>16</DefaultRecSelWidth></Blob>";
			// 
			// lblLable11
			// 
			this.lblLable11.AccessibleDescription = resources.GetString("lblLable11.AccessibleDescription");
			this.lblLable11.AccessibleName = resources.GetString("lblLable11.AccessibleName");
			this.lblLable11.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLable11.Anchor")));
			this.lblLable11.AutoSize = ((bool)(resources.GetObject("lblLable11.AutoSize")));
			this.lblLable11.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLable11.Dock")));
			this.lblLable11.Enabled = ((bool)(resources.GetObject("lblLable11.Enabled")));
			this.lblLable11.Font = ((System.Drawing.Font)(resources.GetObject("lblLable11.Font")));
			this.lblLable11.Image = ((System.Drawing.Image)(resources.GetObject("lblLable11.Image")));
			this.lblLable11.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable11.ImageAlign")));
			this.lblLable11.ImageIndex = ((int)(resources.GetObject("lblLable11.ImageIndex")));
			this.lblLable11.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLable11.ImeMode")));
			this.lblLable11.Location = ((System.Drawing.Point)(resources.GetObject("lblLable11.Location")));
			this.lblLable11.Name = "lblLable11";
			this.lblLable11.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLable11.RightToLeft")));
			this.lblLable11.Size = ((System.Drawing.Size)(resources.GetObject("lblLable11.Size")));
			this.lblLable11.TabIndex = ((int)(resources.GetObject("lblLable11.TabIndex")));
			this.lblLable11.Text = resources.GetString("lblLable11.Text");
			this.lblLable11.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable11.TextAlign")));
			this.lblLable11.Visible = ((bool)(resources.GetObject("lblLable11.Visible")));
			// 
			// chkSelectAll
			// 
			this.chkSelectAll.AccessibleDescription = resources.GetString("chkSelectAll.AccessibleDescription");
			this.chkSelectAll.AccessibleName = resources.GetString("chkSelectAll.AccessibleName");
			this.chkSelectAll.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("chkSelectAll.Anchor")));
			this.chkSelectAll.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("chkSelectAll.Appearance")));
			this.chkSelectAll.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("chkSelectAll.BackgroundImage")));
			this.chkSelectAll.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkSelectAll.CheckAlign")));
			this.chkSelectAll.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("chkSelectAll.Dock")));
			this.chkSelectAll.Enabled = ((bool)(resources.GetObject("chkSelectAll.Enabled")));
			this.chkSelectAll.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("chkSelectAll.FlatStyle")));
			this.chkSelectAll.Font = ((System.Drawing.Font)(resources.GetObject("chkSelectAll.Font")));
			this.chkSelectAll.Image = ((System.Drawing.Image)(resources.GetObject("chkSelectAll.Image")));
			this.chkSelectAll.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkSelectAll.ImageAlign")));
			this.chkSelectAll.ImageIndex = ((int)(resources.GetObject("chkSelectAll.ImageIndex")));
			this.chkSelectAll.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("chkSelectAll.ImeMode")));
			this.chkSelectAll.Location = ((System.Drawing.Point)(resources.GetObject("chkSelectAll.Location")));
			this.chkSelectAll.Name = "chkSelectAll";
			this.chkSelectAll.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("chkSelectAll.RightToLeft")));
			this.chkSelectAll.Size = ((System.Drawing.Size)(resources.GetObject("chkSelectAll.Size")));
			this.chkSelectAll.TabIndex = ((int)(resources.GetObject("chkSelectAll.TabIndex")));
			this.chkSelectAll.Text = resources.GetString("chkSelectAll.Text");
			this.chkSelectAll.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkSelectAll.TextAlign")));
			this.chkSelectAll.Visible = ((bool)(resources.GetObject("chkSelectAll.Visible")));
			this.chkSelectAll.Enter += new System.EventHandler(this.chkSelectAll_Enter);
			this.chkSelectAll.Leave += new System.EventHandler(this.chkSelectAll_Leave);
			this.chkSelectAll.CheckedChanged += new System.EventHandler(this.chkSelectAll_CheckedChanged);
			// 
			// lblLable3
			// 
			this.lblLable3.AccessibleDescription = resources.GetString("lblLable3.AccessibleDescription");
			this.lblLable3.AccessibleName = resources.GetString("lblLable3.AccessibleName");
			this.lblLable3.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLable3.Anchor")));
			this.lblLable3.AutoSize = ((bool)(resources.GetObject("lblLable3.AutoSize")));
			this.lblLable3.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLable3.Dock")));
			this.lblLable3.Enabled = ((bool)(resources.GetObject("lblLable3.Enabled")));
			this.lblLable3.Font = ((System.Drawing.Font)(resources.GetObject("lblLable3.Font")));
			this.lblLable3.ForeColor = System.Drawing.Color.Maroon;
			this.lblLable3.Image = ((System.Drawing.Image)(resources.GetObject("lblLable3.Image")));
			this.lblLable3.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable3.ImageAlign")));
			this.lblLable3.ImageIndex = ((int)(resources.GetObject("lblLable3.ImageIndex")));
			this.lblLable3.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLable3.ImeMode")));
			this.lblLable3.Location = ((System.Drawing.Point)(resources.GetObject("lblLable3.Location")));
			this.lblLable3.Name = "lblLable3";
			this.lblLable3.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLable3.RightToLeft")));
			this.lblLable3.Size = ((System.Drawing.Size)(resources.GetObject("lblLable3.Size")));
			this.lblLable3.TabIndex = ((int)(resources.GetObject("lblLable3.TabIndex")));
			this.lblLable3.Text = resources.GetString("lblLable3.Text");
			this.lblLable3.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable3.TextAlign")));
			this.lblLable3.Visible = ((bool)(resources.GetObject("lblLable3.Visible")));
			// 
			// txtSaleOrderCode
			// 
			this.txtSaleOrderCode.AccessibleDescription = resources.GetString("txtSaleOrderCode.AccessibleDescription");
			this.txtSaleOrderCode.AccessibleName = resources.GetString("txtSaleOrderCode.AccessibleName");
			this.txtSaleOrderCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtSaleOrderCode.Anchor")));
			this.txtSaleOrderCode.AutoSize = ((bool)(resources.GetObject("txtSaleOrderCode.AutoSize")));
			this.txtSaleOrderCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtSaleOrderCode.BackgroundImage")));
			this.txtSaleOrderCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtSaleOrderCode.Dock")));
			this.txtSaleOrderCode.Enabled = ((bool)(resources.GetObject("txtSaleOrderCode.Enabled")));
			this.txtSaleOrderCode.Font = ((System.Drawing.Font)(resources.GetObject("txtSaleOrderCode.Font")));
			this.txtSaleOrderCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtSaleOrderCode.ImeMode")));
			this.txtSaleOrderCode.Location = ((System.Drawing.Point)(resources.GetObject("txtSaleOrderCode.Location")));
			this.txtSaleOrderCode.MaxLength = ((int)(resources.GetObject("txtSaleOrderCode.MaxLength")));
			this.txtSaleOrderCode.Multiline = ((bool)(resources.GetObject("txtSaleOrderCode.Multiline")));
			this.txtSaleOrderCode.Name = "txtSaleOrderCode";
			this.txtSaleOrderCode.PasswordChar = ((char)(resources.GetObject("txtSaleOrderCode.PasswordChar")));
			this.txtSaleOrderCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtSaleOrderCode.RightToLeft")));
			this.txtSaleOrderCode.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtSaleOrderCode.ScrollBars")));
			this.txtSaleOrderCode.Size = ((System.Drawing.Size)(resources.GetObject("txtSaleOrderCode.Size")));
			this.txtSaleOrderCode.TabIndex = ((int)(resources.GetObject("txtSaleOrderCode.TabIndex")));
			this.txtSaleOrderCode.Text = resources.GetString("txtSaleOrderCode.Text");
			this.txtSaleOrderCode.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtSaleOrderCode.TextAlign")));
			this.txtSaleOrderCode.Visible = ((bool)(resources.GetObject("txtSaleOrderCode.Visible")));
			this.txtSaleOrderCode.WordWrap = ((bool)(resources.GetObject("txtSaleOrderCode.WordWrap")));
			this.txtSaleOrderCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSaleOrderCode_KeyDown);
			this.txtSaleOrderCode.Leave += new System.EventHandler(this.txtSaleOrderCode_Leave);
			this.txtSaleOrderCode.Enter += new System.EventHandler(this.OnEnterControl);
			// 
			// lblLable7
			// 
			this.lblLable7.AccessibleDescription = resources.GetString("lblLable7.AccessibleDescription");
			this.lblLable7.AccessibleName = resources.GetString("lblLable7.AccessibleName");
			this.lblLable7.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLable7.Anchor")));
			this.lblLable7.AutoSize = ((bool)(resources.GetObject("lblLable7.AutoSize")));
			this.lblLable7.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLable7.Dock")));
			this.lblLable7.Enabled = ((bool)(resources.GetObject("lblLable7.Enabled")));
			this.lblLable7.Font = ((System.Drawing.Font)(resources.GetObject("lblLable7.Font")));
			this.lblLable7.Image = ((System.Drawing.Image)(resources.GetObject("lblLable7.Image")));
			this.lblLable7.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable7.ImageAlign")));
			this.lblLable7.ImageIndex = ((int)(resources.GetObject("lblLable7.ImageIndex")));
			this.lblLable7.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLable7.ImeMode")));
			this.lblLable7.Location = ((System.Drawing.Point)(resources.GetObject("lblLable7.Location")));
			this.lblLable7.Name = "lblLable7";
			this.lblLable7.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLable7.RightToLeft")));
			this.lblLable7.Size = ((System.Drawing.Size)(resources.GetObject("lblLable7.Size")));
			this.lblLable7.TabIndex = ((int)(resources.GetObject("lblLable7.TabIndex")));
			this.lblLable7.Text = resources.GetString("lblLable7.Text");
			this.lblLable7.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable7.TextAlign")));
			this.lblLable7.Visible = ((bool)(resources.GetObject("lblLable7.Visible")));
			// 
			// dgrdData
			// 
			this.dgrdData.AccessibleDescription = resources.GetString("dgrdData.AccessibleDescription");
			this.dgrdData.AccessibleName = resources.GetString("dgrdData.AccessibleName");
			this.dgrdData.AllowAddNew = ((bool)(resources.GetObject("dgrdData.AllowAddNew")));
			this.dgrdData.AllowArrows = ((bool)(resources.GetObject("dgrdData.AllowArrows")));
			this.dgrdData.AllowColMove = ((bool)(resources.GetObject("dgrdData.AllowColMove")));
			this.dgrdData.AllowColSelect = ((bool)(resources.GetObject("dgrdData.AllowColSelect")));
			this.dgrdData.AllowDelete = ((bool)(resources.GetObject("dgrdData.AllowDelete")));
			this.dgrdData.AllowDrag = ((bool)(resources.GetObject("dgrdData.AllowDrag")));
			this.dgrdData.AllowFilter = ((bool)(resources.GetObject("dgrdData.AllowFilter")));
			this.dgrdData.AllowHorizontalSplit = ((bool)(resources.GetObject("dgrdData.AllowHorizontalSplit")));
			this.dgrdData.AllowRowSelect = ((bool)(resources.GetObject("dgrdData.AllowRowSelect")));
			this.dgrdData.AllowSort = ((bool)(resources.GetObject("dgrdData.AllowSort")));
			this.dgrdData.AllowUpdate = ((bool)(resources.GetObject("dgrdData.AllowUpdate")));
			this.dgrdData.AllowUpdateOnBlur = ((bool)(resources.GetObject("dgrdData.AllowUpdateOnBlur")));
			this.dgrdData.AllowVerticalSplit = ((bool)(resources.GetObject("dgrdData.AllowVerticalSplit")));
			this.dgrdData.AlternatingRows = ((bool)(resources.GetObject("dgrdData.AlternatingRows")));
			this.dgrdData.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrdData.Anchor")));
			this.dgrdData.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrdData.BackgroundImage")));
			this.dgrdData.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dgrdData.BorderStyle")));
			this.dgrdData.Caption = resources.GetString("dgrdData.Caption");
			this.dgrdData.CaptionHeight = ((int)(resources.GetObject("dgrdData.CaptionHeight")));
			this.dgrdData.CellTipsDelay = ((int)(resources.GetObject("dgrdData.CellTipsDelay")));
			this.dgrdData.CellTipsWidth = ((int)(resources.GetObject("dgrdData.CellTipsWidth")));
			this.dgrdData.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("dgrdData.ChildGrid")));
			this.dgrdData.CollapseColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.CollapseColor")));
			this.dgrdData.ColumnFooters = ((bool)(resources.GetObject("dgrdData.ColumnFooters")));
			this.dgrdData.ColumnHeaders = ((bool)(resources.GetObject("dgrdData.ColumnHeaders")));
			this.dgrdData.DefColWidth = ((int)(resources.GetObject("dgrdData.DefColWidth")));
			this.dgrdData.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrdData.Dock")));
			this.dgrdData.EditDropDown = ((bool)(resources.GetObject("dgrdData.EditDropDown")));
			this.dgrdData.EmptyRows = ((bool)(resources.GetObject("dgrdData.EmptyRows")));
			this.dgrdData.Enabled = ((bool)(resources.GetObject("dgrdData.Enabled")));
			this.dgrdData.ExpandColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.ExpandColor")));
			this.dgrdData.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("dgrdData.ExposeCellMode")));
			this.dgrdData.ExtendRightColumn = ((bool)(resources.GetObject("dgrdData.ExtendRightColumn")));
			this.dgrdData.FetchRowStyles = ((bool)(resources.GetObject("dgrdData.FetchRowStyles")));
			this.dgrdData.FilterBar = ((bool)(resources.GetObject("dgrdData.FilterBar")));
			this.dgrdData.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("dgrdData.FlatStyle")));
			this.dgrdData.Font = ((System.Drawing.Font)(resources.GetObject("dgrdData.Font")));
			this.dgrdData.GroupByAreaVisible = ((bool)(resources.GetObject("dgrdData.GroupByAreaVisible")));
			this.dgrdData.GroupByCaption = resources.GetString("dgrdData.GroupByCaption");
			this.dgrdData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
			this.dgrdData.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrdData.ImeMode")));
			this.dgrdData.LinesPerRow = ((int)(resources.GetObject("dgrdData.LinesPerRow")));
			this.dgrdData.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.Location")));
			this.dgrdData.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
			this.dgrdData.Name = "dgrdData";
			this.dgrdData.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureAddnewRow")));
			this.dgrdData.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureCurrentRow")));
			this.dgrdData.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFilterBar")));
			this.dgrdData.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFooterRow")));
			this.dgrdData.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureHeaderRow")));
			this.dgrdData.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureModifiedRow")));
			this.dgrdData.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureStandardRow")));
			this.dgrdData.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("dgrdData.PreviewInfo.AllowSizing")));
			this.dgrdData.PreviewInfo.Caption = resources.GetString("dgrdData.PreviewInfo.Caption");
			this.dgrdData.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.PreviewInfo.Location")));
			this.dgrdData.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.PreviewInfo.Size")));
			this.dgrdData.PreviewInfo.ToolBars = ((bool)(resources.GetObject("dgrdData.PreviewInfo.ToolBars")));
			this.dgrdData.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("dgrdData.PreviewInfo.UIStrings.Content")));
			this.dgrdData.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("dgrdData.PreviewInfo.ZoomFactor")));
			this.dgrdData.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.MaxRowHeight")));
			this.dgrdData.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageFooter")));
			this.dgrdData.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageHeader")));
			this.dgrdData.PrintInfo.PageFooter = resources.GetString("dgrdData.PrintInfo.PageFooter");
			this.dgrdData.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageFooterHeight")));
			this.dgrdData.PrintInfo.PageHeader = resources.GetString("dgrdData.PrintInfo.PageHeader");
			this.dgrdData.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageHeaderHeight")));
			this.dgrdData.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("dgrdData.PrintInfo.PrintHorizontalSplits")));
			this.dgrdData.PrintInfo.ProgressCaption = resources.GetString("dgrdData.PrintInfo.ProgressCaption");
			this.dgrdData.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnFooters")));
			this.dgrdData.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnHeaders")));
			this.dgrdData.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatGridHeader")));
			this.dgrdData.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatSplitHeaders")));
			this.dgrdData.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowOptionsDialog")));
			this.dgrdData.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowProgressForm")));
			this.dgrdData.PrintInfo.ShowSelection = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowSelection")));
			this.dgrdData.PrintInfo.UseGridColors = ((bool)(resources.GetObject("dgrdData.PrintInfo.UseGridColors")));
			this.dgrdData.RecordSelectors = ((bool)(resources.GetObject("dgrdData.RecordSelectors")));
			this.dgrdData.RecordSelectorWidth = ((int)(resources.GetObject("dgrdData.RecordSelectorWidth")));
			this.dgrdData.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrdData.RightToLeft")));
			this.dgrdData.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
			this.dgrdData.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
			this.dgrdData.RowHeight = ((int)(resources.GetObject("dgrdData.RowHeight")));
			this.dgrdData.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.RowSubDividerColor")));
			this.dgrdData.ScrollTips = ((bool)(resources.GetObject("dgrdData.ScrollTips")));
			this.dgrdData.ScrollTrack = ((bool)(resources.GetObject("dgrdData.ScrollTrack")));
			this.dgrdData.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.Size")));
			this.dgrdData.SpringMode = ((bool)(resources.GetObject("dgrdData.SpringMode")));
			this.dgrdData.TabAcrossSplits = ((bool)(resources.GetObject("dgrdData.TabAcrossSplits")));
			this.dgrdData.TabIndex = ((int)(resources.GetObject("dgrdData.TabIndex")));
			this.dgrdData.Text = resources.GetString("dgrdData.Text");
			this.dgrdData.ViewCaptionWidth = ((int)(resources.GetObject("dgrdData.ViewCaptionWidth")));
			this.dgrdData.ViewColumnWidth = ((int)(resources.GetObject("dgrdData.ViewColumnWidth")));
			this.dgrdData.Visible = ((bool)(resources.GetObject("dgrdData.Visible")));
			this.dgrdData.WrapCellPointer = ((bool)(resources.GetObject("dgrdData.WrapCellPointer")));
			this.dgrdData.AfterColEdit += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_AfterColEdit);
			this.dgrdData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown);
			this.dgrdData.PropBag = resources.GetString("dgrdData.PropBag");
			// 
			// btnFindSaleOrder
			// 
			this.btnFindSaleOrder.AccessibleDescription = resources.GetString("btnFindSaleOrder.AccessibleDescription");
			this.btnFindSaleOrder.AccessibleName = resources.GetString("btnFindSaleOrder.AccessibleName");
			this.btnFindSaleOrder.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnFindSaleOrder.Anchor")));
			this.btnFindSaleOrder.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnFindSaleOrder.BackgroundImage")));
			this.btnFindSaleOrder.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnFindSaleOrder.Dock")));
			this.btnFindSaleOrder.Enabled = ((bool)(resources.GetObject("btnFindSaleOrder.Enabled")));
			this.btnFindSaleOrder.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnFindSaleOrder.FlatStyle")));
			this.btnFindSaleOrder.Font = ((System.Drawing.Font)(resources.GetObject("btnFindSaleOrder.Font")));
			this.btnFindSaleOrder.Image = ((System.Drawing.Image)(resources.GetObject("btnFindSaleOrder.Image")));
			this.btnFindSaleOrder.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnFindSaleOrder.ImageAlign")));
			this.btnFindSaleOrder.ImageIndex = ((int)(resources.GetObject("btnFindSaleOrder.ImageIndex")));
			this.btnFindSaleOrder.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnFindSaleOrder.ImeMode")));
			this.btnFindSaleOrder.Location = ((System.Drawing.Point)(resources.GetObject("btnFindSaleOrder.Location")));
			this.btnFindSaleOrder.Name = "btnFindSaleOrder";
			this.btnFindSaleOrder.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnFindSaleOrder.RightToLeft")));
			this.btnFindSaleOrder.Size = ((System.Drawing.Size)(resources.GetObject("btnFindSaleOrder.Size")));
			this.btnFindSaleOrder.TabIndex = ((int)(resources.GetObject("btnFindSaleOrder.TabIndex")));
			this.btnFindSaleOrder.Text = resources.GetString("btnFindSaleOrder.Text");
			this.btnFindSaleOrder.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnFindSaleOrder.TextAlign")));
			this.btnFindSaleOrder.Visible = ((bool)(resources.GetObject("btnFindSaleOrder.Visible")));
			this.btnFindSaleOrder.Click += new System.EventHandler(this.btnFindSaleOrder_Click);
			// 
			// lblLable1
			// 
			this.lblLable1.AccessibleDescription = resources.GetString("lblLable1.AccessibleDescription");
			this.lblLable1.AccessibleName = resources.GetString("lblLable1.AccessibleName");
			this.lblLable1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLable1.Anchor")));
			this.lblLable1.AutoSize = ((bool)(resources.GetObject("lblLable1.AutoSize")));
			this.lblLable1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLable1.Dock")));
			this.lblLable1.Enabled = ((bool)(resources.GetObject("lblLable1.Enabled")));
			this.lblLable1.Font = ((System.Drawing.Font)(resources.GetObject("lblLable1.Font")));
			this.lblLable1.Image = ((System.Drawing.Image)(resources.GetObject("lblLable1.Image")));
			this.lblLable1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable1.ImageAlign")));
			this.lblLable1.ImageIndex = ((int)(resources.GetObject("lblLable1.ImageIndex")));
			this.lblLable1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLable1.ImeMode")));
			this.lblLable1.Location = ((System.Drawing.Point)(resources.GetObject("lblLable1.Location")));
			this.lblLable1.Name = "lblLable1";
			this.lblLable1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLable1.RightToLeft")));
			this.lblLable1.Size = ((System.Drawing.Size)(resources.GetObject("lblLable1.Size")));
			this.lblLable1.TabIndex = ((int)(resources.GetObject("lblLable1.TabIndex")));
			this.lblLable1.Text = resources.GetString("lblLable1.Text");
			this.lblLable1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable1.TextAlign")));
			this.lblLable1.Visible = ((bool)(resources.GetObject("lblLable1.Visible")));
			// 
			// btnSearch
			// 
			this.btnSearch.AccessibleDescription = resources.GetString("btnSearch.AccessibleDescription");
			this.btnSearch.AccessibleName = resources.GetString("btnSearch.AccessibleName");
			this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearch.Anchor")));
			this.btnSearch.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearch.BackgroundImage")));
			this.btnSearch.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearch.Dock")));
			this.btnSearch.Enabled = ((bool)(resources.GetObject("btnSearch.Enabled")));
			this.btnSearch.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearch.FlatStyle")));
			this.btnSearch.Font = ((System.Drawing.Font)(resources.GetObject("btnSearch.Font")));
			this.btnSearch.Image = ((System.Drawing.Image)(resources.GetObject("btnSearch.Image")));
			this.btnSearch.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearch.ImageAlign")));
			this.btnSearch.ImageIndex = ((int)(resources.GetObject("btnSearch.ImageIndex")));
			this.btnSearch.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearch.ImeMode")));
			this.btnSearch.Location = ((System.Drawing.Point)(resources.GetObject("btnSearch.Location")));
			this.btnSearch.Name = "btnSearch";
			this.btnSearch.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearch.RightToLeft")));
			this.btnSearch.Size = ((System.Drawing.Size)(resources.GetObject("btnSearch.Size")));
			this.btnSearch.TabIndex = ((int)(resources.GetObject("btnSearch.TabIndex")));
			this.btnSearch.Text = resources.GetString("btnSearch.Text");
			this.btnSearch.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearch.TextAlign")));
			this.btnSearch.Visible = ((bool)(resources.GetObject("btnSearch.Visible")));
			this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
			// 
			// txtBuyingLoc
			// 
			this.txtBuyingLoc.AccessibleDescription = resources.GetString("txtBuyingLoc.AccessibleDescription");
			this.txtBuyingLoc.AccessibleName = resources.GetString("txtBuyingLoc.AccessibleName");
			this.txtBuyingLoc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtBuyingLoc.Anchor")));
			this.txtBuyingLoc.AutoSize = ((bool)(resources.GetObject("txtBuyingLoc.AutoSize")));
			this.txtBuyingLoc.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtBuyingLoc.BackgroundImage")));
			this.txtBuyingLoc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtBuyingLoc.Dock")));
			this.txtBuyingLoc.Enabled = ((bool)(resources.GetObject("txtBuyingLoc.Enabled")));
			this.txtBuyingLoc.Font = ((System.Drawing.Font)(resources.GetObject("txtBuyingLoc.Font")));
			this.txtBuyingLoc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtBuyingLoc.ImeMode")));
			this.txtBuyingLoc.Location = ((System.Drawing.Point)(resources.GetObject("txtBuyingLoc.Location")));
			this.txtBuyingLoc.MaxLength = ((int)(resources.GetObject("txtBuyingLoc.MaxLength")));
			this.txtBuyingLoc.Multiline = ((bool)(resources.GetObject("txtBuyingLoc.Multiline")));
			this.txtBuyingLoc.Name = "txtBuyingLoc";
			this.txtBuyingLoc.PasswordChar = ((char)(resources.GetObject("txtBuyingLoc.PasswordChar")));
			this.txtBuyingLoc.ReadOnly = true;
			this.txtBuyingLoc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtBuyingLoc.RightToLeft")));
			this.txtBuyingLoc.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtBuyingLoc.ScrollBars")));
			this.txtBuyingLoc.Size = ((System.Drawing.Size)(resources.GetObject("txtBuyingLoc.Size")));
			this.txtBuyingLoc.TabIndex = ((int)(resources.GetObject("txtBuyingLoc.TabIndex")));
			this.txtBuyingLoc.TabStop = false;
			this.txtBuyingLoc.Text = resources.GetString("txtBuyingLoc.Text");
			this.txtBuyingLoc.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtBuyingLoc.TextAlign")));
			this.txtBuyingLoc.Visible = ((bool)(resources.GetObject("txtBuyingLoc.Visible")));
			this.txtBuyingLoc.WordWrap = ((bool)(resources.GetObject("txtBuyingLoc.WordWrap")));
			// 
			// txtCustomer
			// 
			this.txtCustomer.AccessibleDescription = resources.GetString("txtCustomer.AccessibleDescription");
			this.txtCustomer.AccessibleName = resources.GetString("txtCustomer.AccessibleName");
			this.txtCustomer.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtCustomer.Anchor")));
			this.txtCustomer.AutoSize = ((bool)(resources.GetObject("txtCustomer.AutoSize")));
			this.txtCustomer.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtCustomer.BackgroundImage")));
			this.txtCustomer.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtCustomer.Dock")));
			this.txtCustomer.Enabled = ((bool)(resources.GetObject("txtCustomer.Enabled")));
			this.txtCustomer.Font = ((System.Drawing.Font)(resources.GetObject("txtCustomer.Font")));
			this.txtCustomer.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtCustomer.ImeMode")));
			this.txtCustomer.Location = ((System.Drawing.Point)(resources.GetObject("txtCustomer.Location")));
			this.txtCustomer.MaxLength = ((int)(resources.GetObject("txtCustomer.MaxLength")));
			this.txtCustomer.Multiline = ((bool)(resources.GetObject("txtCustomer.Multiline")));
			this.txtCustomer.Name = "txtCustomer";
			this.txtCustomer.PasswordChar = ((char)(resources.GetObject("txtCustomer.PasswordChar")));
			this.txtCustomer.ReadOnly = true;
			this.txtCustomer.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtCustomer.RightToLeft")));
			this.txtCustomer.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtCustomer.ScrollBars")));
			this.txtCustomer.Size = ((System.Drawing.Size)(resources.GetObject("txtCustomer.Size")));
			this.txtCustomer.TabIndex = ((int)(resources.GetObject("txtCustomer.TabIndex")));
			this.txtCustomer.TabStop = false;
			this.txtCustomer.Text = resources.GetString("txtCustomer.Text");
			this.txtCustomer.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtCustomer.TextAlign")));
			this.txtCustomer.Visible = ((bool)(resources.GetObject("txtCustomer.Visible")));
			this.txtCustomer.WordWrap = ((bool)(resources.GetObject("txtCustomer.WordWrap")));
			// 
			// txtCustomerName
			// 
			this.txtCustomerName.AccessibleDescription = resources.GetString("txtCustomerName.AccessibleDescription");
			this.txtCustomerName.AccessibleName = resources.GetString("txtCustomerName.AccessibleName");
			this.txtCustomerName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtCustomerName.Anchor")));
			this.txtCustomerName.AutoSize = ((bool)(resources.GetObject("txtCustomerName.AutoSize")));
			this.txtCustomerName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtCustomerName.BackgroundImage")));
			this.txtCustomerName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtCustomerName.Dock")));
			this.txtCustomerName.Enabled = ((bool)(resources.GetObject("txtCustomerName.Enabled")));
			this.txtCustomerName.Font = ((System.Drawing.Font)(resources.GetObject("txtCustomerName.Font")));
			this.txtCustomerName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtCustomerName.ImeMode")));
			this.txtCustomerName.Location = ((System.Drawing.Point)(resources.GetObject("txtCustomerName.Location")));
			this.txtCustomerName.MaxLength = ((int)(resources.GetObject("txtCustomerName.MaxLength")));
			this.txtCustomerName.Multiline = ((bool)(resources.GetObject("txtCustomerName.Multiline")));
			this.txtCustomerName.Name = "txtCustomerName";
			this.txtCustomerName.PasswordChar = ((char)(resources.GetObject("txtCustomerName.PasswordChar")));
			this.txtCustomerName.ReadOnly = true;
			this.txtCustomerName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtCustomerName.RightToLeft")));
			this.txtCustomerName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtCustomerName.ScrollBars")));
			this.txtCustomerName.Size = ((System.Drawing.Size)(resources.GetObject("txtCustomerName.Size")));
			this.txtCustomerName.TabIndex = ((int)(resources.GetObject("txtCustomerName.TabIndex")));
			this.txtCustomerName.TabStop = false;
			this.txtCustomerName.Text = resources.GetString("txtCustomerName.Text");
			this.txtCustomerName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtCustomerName.TextAlign")));
			this.txtCustomerName.Visible = ((bool)(resources.GetObject("txtCustomerName.Visible")));
			this.txtCustomerName.WordWrap = ((bool)(resources.GetObject("txtCustomerName.WordWrap")));
			// 
			// txtQuote
			// 
			this.txtQuote.AccessibleDescription = resources.GetString("txtQuote.AccessibleDescription");
			this.txtQuote.AccessibleName = resources.GetString("txtQuote.AccessibleName");
			this.txtQuote.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtQuote.Anchor")));
			this.txtQuote.AutoSize = ((bool)(resources.GetObject("txtQuote.AutoSize")));
			this.txtQuote.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtQuote.BackgroundImage")));
			this.txtQuote.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtQuote.Dock")));
			this.txtQuote.Enabled = ((bool)(resources.GetObject("txtQuote.Enabled")));
			this.txtQuote.Font = ((System.Drawing.Font)(resources.GetObject("txtQuote.Font")));
			this.txtQuote.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtQuote.ImeMode")));
			this.txtQuote.Location = ((System.Drawing.Point)(resources.GetObject("txtQuote.Location")));
			this.txtQuote.MaxLength = ((int)(resources.GetObject("txtQuote.MaxLength")));
			this.txtQuote.Multiline = ((bool)(resources.GetObject("txtQuote.Multiline")));
			this.txtQuote.Name = "txtQuote";
			this.txtQuote.PasswordChar = ((char)(resources.GetObject("txtQuote.PasswordChar")));
			this.txtQuote.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtQuote.RightToLeft")));
			this.txtQuote.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtQuote.ScrollBars")));
			this.txtQuote.Size = ((System.Drawing.Size)(resources.GetObject("txtQuote.Size")));
			this.txtQuote.TabIndex = ((int)(resources.GetObject("txtQuote.TabIndex")));
			this.txtQuote.Text = resources.GetString("txtQuote.Text");
			this.txtQuote.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtQuote.TextAlign")));
			this.txtQuote.Visible = ((bool)(resources.GetObject("txtQuote.Visible")));
			this.txtQuote.WordWrap = ((bool)(resources.GetObject("txtQuote.WordWrap")));
			this.txtQuote.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtQuote_KeyDown);
			this.txtQuote.Validating += new System.ComponentModel.CancelEventHandler(this.txtQuote_Validating);
			// 
			// btnQuote
			// 
			this.btnQuote.AccessibleDescription = resources.GetString("btnQuote.AccessibleDescription");
			this.btnQuote.AccessibleName = resources.GetString("btnQuote.AccessibleName");
			this.btnQuote.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnQuote.Anchor")));
			this.btnQuote.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnQuote.BackgroundImage")));
			this.btnQuote.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnQuote.Dock")));
			this.btnQuote.Enabled = ((bool)(resources.GetObject("btnQuote.Enabled")));
			this.btnQuote.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnQuote.FlatStyle")));
			this.btnQuote.Font = ((System.Drawing.Font)(resources.GetObject("btnQuote.Font")));
			this.btnQuote.Image = ((System.Drawing.Image)(resources.GetObject("btnQuote.Image")));
			this.btnQuote.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnQuote.ImageAlign")));
			this.btnQuote.ImageIndex = ((int)(resources.GetObject("btnQuote.ImageIndex")));
			this.btnQuote.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnQuote.ImeMode")));
			this.btnQuote.Location = ((System.Drawing.Point)(resources.GetObject("btnQuote.Location")));
			this.btnQuote.Name = "btnQuote";
			this.btnQuote.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnQuote.RightToLeft")));
			this.btnQuote.Size = ((System.Drawing.Size)(resources.GetObject("btnQuote.Size")));
			this.btnQuote.TabIndex = ((int)(resources.GetObject("btnQuote.TabIndex")));
			this.btnQuote.Text = resources.GetString("btnQuote.Text");
			this.btnQuote.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnQuote.TextAlign")));
			this.btnQuote.Visible = ((bool)(resources.GetObject("btnQuote.Visible")));
			this.btnQuote.Click += new System.EventHandler(this.btnQuote_Click);
			// 
			// lblQuote
			// 
			this.lblQuote.AccessibleDescription = resources.GetString("lblQuote.AccessibleDescription");
			this.lblQuote.AccessibleName = resources.GetString("lblQuote.AccessibleName");
			this.lblQuote.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblQuote.Anchor")));
			this.lblQuote.AutoSize = ((bool)(resources.GetObject("lblQuote.AutoSize")));
			this.lblQuote.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblQuote.Dock")));
			this.lblQuote.Enabled = ((bool)(resources.GetObject("lblQuote.Enabled")));
			this.lblQuote.Font = ((System.Drawing.Font)(resources.GetObject("lblQuote.Font")));
			this.lblQuote.ForeColor = System.Drawing.Color.Maroon;
			this.lblQuote.Image = ((System.Drawing.Image)(resources.GetObject("lblQuote.Image")));
			this.lblQuote.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblQuote.ImageAlign")));
			this.lblQuote.ImageIndex = ((int)(resources.GetObject("lblQuote.ImageIndex")));
			this.lblQuote.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblQuote.ImeMode")));
			this.lblQuote.Location = ((System.Drawing.Point)(resources.GetObject("lblQuote.Location")));
			this.lblQuote.Name = "lblQuote";
			this.lblQuote.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblQuote.RightToLeft")));
			this.lblQuote.Size = ((System.Drawing.Size)(resources.GetObject("lblQuote.Size")));
			this.lblQuote.TabIndex = ((int)(resources.GetObject("lblQuote.TabIndex")));
			this.lblQuote.Text = resources.GetString("lblQuote.Text");
			this.lblQuote.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblQuote.TextAlign")));
			this.lblQuote.Visible = ((bool)(resources.GetObject("lblQuote.Visible")));
			// 
			// SOCancelCommitment
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.txtQuote);
			this.Controls.Add(this.btnQuote);
			this.Controls.Add(this.lblQuote);
			this.Controls.Add(this.txtCustomerName);
			this.Controls.Add(this.txtCustomer);
			this.Controls.Add(this.txtBuyingLoc);
			this.Controls.Add(this.txtSaleOrderCode);
			this.Controls.Add(this.dgrdData);
			this.Controls.Add(this.btnSearch);
			this.Controls.Add(this.btnFindSaleOrder);
			this.Controls.Add(this.chkSelectAll);
			this.Controls.Add(this.lblLable7);
			this.Controls.Add(this.lblLable1);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.btnCancelCommitment);
			this.Controls.Add(this.btnHelp);
			this.Controls.Add(this.lblLable11);
			this.Controls.Add(this.lblLable3);
			this.Controls.Add(this.lblLable12);
			this.Controls.Add(this.cboCCN);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.KeyPreview = true;
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "SOCancelCommitment";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SOCancelCommitment_KeyDown);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.SOCancelCommitment_Closing);
			this.Load += new System.EventHandler(this.SOCancelCommitment_Load);
			((System.ComponentModel.ISupportInitialize)(this.cboCCN)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dgrdData)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		//**************************************************************************              
		///    <Description>
		///       Get current column's headers on the grid
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Wednesday, March 02, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void GetCaptionOnGrid()
		{
			CaptionLine = dgrdData.Splits[0].DisplayColumns[SO_CommitInventoryDetailTable.LINE_FLD].DataColumn.Caption;
			CaptionDelivery = dgrdData.Splits[0].DisplayColumns[DELIVERY].DataColumn.Caption;
			CaptionMasterLocation = dgrdData.Splits[0].DisplayColumns[MASTERLOCATION].DataColumn.Caption;
			CaptionCommitQuantity = dgrdData.Splits[0].DisplayColumns[SO_CommitInventoryDetailTable.COMMITQUANTITY_FLD].DataColumn.Caption;
			CaptionUnitOfMeasure = dgrdData.Splits[0].DisplayColumns[UNITOFMEASURE].DataColumn.Caption;
			CaptionLocation = dgrdData.Splits[0].DisplayColumns[LOCATION].DataColumn.Caption;
			CaptionBin = dgrdData.Splits[0].DisplayColumns[BIN].DataColumn.Caption;
			CaptionProductCode = dgrdData.Splits[0].DisplayColumns[PRODUCTCODE].DataColumn.Caption;
			CaptionProductDes = dgrdData.Splits[0].DisplayColumns[PRODUCTDES].DataColumn.Caption;
			CaptionCancel = dgrdData.Splits[0].DisplayColumns[CANCEL].DataColumn.Caption;
			for(int i =0; i<dgrdData.Splits[0].DisplayColumns.Count; i++)
			{
				dgrdData.Splits[0].DisplayColumns[i].HeadingStyle.HorizontalAlignment = AlignHorzEnum.Center;
			}
		}

		//**************************************************************************              
		///    <Description>
		///       Reset all control and set focus into txtSaleOrderCode
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Wednesday, March 02, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void ResetForm()
		{
			txtSaleOrderCode.Text = string.Empty;
			txtCustomer.Text = string.Empty;
			txtCustomerName.Text = string.Empty;
			txtBuyingLoc.Text = string.Empty;

			chkSelectAll.Checked = false;
			txtSaleOrderCode.Focus();

			dgrdData.Splits[0].Rows.Clear();
		}


		//**************************************************************************              
		///    <Description>
		///       Load all data in to Combo CCN 
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Friday, February 25, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void LoadComboCCN()
		{
			try
			{
				UtilsBO boUtils = new UtilsBO();
				DataSet dstCCN = boUtils.ListCCN();
				cboCCN.DataSource = dstCCN.Tables[MST_CCNTable.TABLE_NAME];
				cboCCN.DisplayMember = MST_CCNTable.CODE_FLD;
				cboCCN.ValueMember = MST_CCNTable.CCNID_FLD;
				FormControlComponents.PutDataIntoC1ComboBox(cboCCN,dstCCN.Tables[MST_CCNTable.TABLE_NAME],MST_CCNTable.CODE_FLD,MST_CCNTable.CCNID_FLD,MST_CCNTable.TABLE_NAME);
				if (SystemProperty.CCNID != 0)
				{
					cboCCN.SelectedIndex = 0;
				}
			}
			catch (PCSException ex)
			{
				throw ex;
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}


		//**************************************************************************              
		///    <Description>
		///       Execute searching items to display on the grid by Code or by ID
		///    </Description>
		///    <Inputs>
		///		 pstrSaleOrderCode is Code of SaleOrder
		///		 pintSOID is ID of SaleOrder
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Friday, February 25, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void BindDataToGrid(int pintSOID)
		{
			try
			{
				dstCancelCommit = new DataSet();
				chkSelectAll.Checked = false;
				dstCancelCommit = boCancelCommitment.ListCancelable(pintSOID);
				dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME].Columns.Add(CANCEL, typeof(bool));
				
				if (dstCancelCommit.Tables[0].Rows.Count != 0)
				{
					foreach (DataRow drow in dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME].Rows)
					{
						drow[CANCEL] = false;
					}
				}
				dgrdData.DataSource = dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME];
				FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
				dgrdData.Splits[0].DisplayColumns[SO_CommitInventoryDetailTable.COMMITQUANTITY_FLD].DataColumn.NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
				dgrdData.Splits[0].DisplayColumns[SO_DeliveryScheduleTable.SCHEDULEDATE_FLD].DataColumn.NumberFormat = Constants.DATETIME_FORMAT_HOUR;
				for (int i =0; i <dgrdData.Splits[0].DisplayColumns.Count; i++)
				{
					if (dgrdData.Splits[0].DisplayColumns[i].DataColumn.DataField != CANCEL)
						dgrdData.Splits[0].DisplayColumns[i].Locked = true;
				}
				btnCancelCommitment.Enabled = dgrdData.RowCount >0;
				dgrdData.AllowDelete = dgrdData.RowCount >0;
			}
			catch (PCSException ex)
			{
				throw ex;
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}


		//**************************************************************************              
		///    <Description>
		///       Check the checking on the grid
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///			Throw PCSExecption if have no item is check
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, March 3, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void ValidateData()
		{
			const string METHOD_NAME = THIS + ".ValidateData()";
			int intCountCheck = 0;
			foreach (DataRow drow in dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME].Rows)
			{
				if (drow.RowState != DataRowState.Deleted)
				{
					if (drow[CANCEL].ToString().Trim() == TRUE)
					{
						intCountCheck++;
						return;
					}
				}
			}
			throw new PCSException(ErrorCode.MESSAGE_CANCELCOMMIT_ATLISTITEMCHECK, METHOD_NAME, null);
		}


		//**************************************************************************              
		///    <Description>
		///       Load form event
		///			Reset and init data
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, March 3, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void SOCancelCommitment_Load(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".SOCancelCommitment_Load()";
			try
			{
				Security objSecurity = new Security();
				this.Name = THIS;
				if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
				{
					this.Close();
					return;
				}
				
				btnCancelCommitment.Enabled = false;
				ResetForm();	
				LoadComboCCN();
				dtbGridLayout = FormControlComponents.StoreGridLayout(dgrdData);
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       Get custumer's inf and Buying location's inf by CustomerID and LocationID
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, March 3, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void GetInfors(int pintPartyID, int pintLocationID)
		{
			MST_Party voCustomer = new MST_Party();
			voCustomer = new PartyBO().GetParty(pintPartyID,string.Empty);
			txtCustomer.Text = voCustomer.Code;
			txtCustomerName.Text = voCustomer.Name;
									
			txtBuyingLoc.Text = new SOCancelCommitmentBO().GetBuyingLocName(pintLocationID);
		}


		//**************************************************************************              
		///    <Description>
		///       Find a SaleOrder
		///			fill data if search success
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, March 3, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnFindSaleOrder_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnFindSaleOrder_Click()";
			try 
			{
				DataRowView drwResult = null;
				Hashtable htbCriteria = new Hashtable();
				if (cboCCN.SelectedValue != null)
				{
					htbCriteria.Add(SO_SaleOrderMasterTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
				}
				else
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Warning);
					cboCCN.Focus();
					return;
				}
				
				drwResult = FormControlComponents.OpenSearchForm(v_SOCancelCommitment.VIEW_NAME , SO_SaleOrderMasterTable.CODE_FLD, txtSaleOrderCode.Text, htbCriteria, true);
				if (drwResult != null)
				{
					txtSaleOrderCode.Text = drwResult[SO_SaleOrderMasterTable.CODE_FLD].ToString();
					int intPartyID = 0, intLocID = 0;
					try
					{
						intPartyID = int.Parse(drwResult[SO_SaleOrderMasterTable.PARTYID_FLD].ToString());
					}
					catch{}
					try
					{
						intLocID = int.Parse(drwResult[SO_SaleOrderMasterTable.BUYINGLOCID_FLD].ToString());
					}
					catch{}
					GetInfors(intPartyID, intLocID);
					voSOMaster.SaleOrderMasterID = int.Parse(drwResult[SO_SaleOrderMasterTable.SALEORDERMASTERID_FLD].ToString());
				}
				else
				{
					txtSaleOrderCode.Focus();
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}


		//**************************************************************************              
		///    <Description>
		///       Check all checkbox on grid and then autocheck chkCheckAll
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Wednesday, March 02, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void CheckOrNochkCheckAll()
		{
			for (int i =0; i <dgrdData.RowCount; i++)
			{
				if (dgrdData[i, CANCEL].ToString().Trim() != TRUE)
				{
					chkSelectAll.Checked = false;
					return;
				}
			}
			chkSelectAll.Checked = true;
		}


		//**************************************************************************              
		///    <Description>
		///       Check all on uncheck all item on grid
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, March 3, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void chkSelectAll_CheckedChanged(object sender, System.EventArgs e)
		{
			if (blnStateOfCheck)
			{
				dgrdData.UpdateData();
				if (dstCancelCommit.Tables.Count == 0) return;
				if (chkSelectAll.Checked)
				{
					foreach (DataRow drow in dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME].Rows)
					{
						if (drow.RowState != DataRowState.Deleted)
							drow[CANCEL] = true;
					}
				}
				else
				{
					foreach (DataRow drow in dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME].Rows)
					{
						if (drow.RowState != DataRowState.Deleted)
							drow[CANCEL] = false;
					}
				}
			}
		}


		private void dgrdData_AfterColEdit(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
		{
			if (e.Column.DataColumn.DataField == CANCEL)
			{
				CheckOrNochkCheckAll();
			}
		}


		private void chkSelectAll_Enter(object sender, System.EventArgs e)
		{
			blnStateOfCheck = true;
		}


		private void chkSelectAll_Leave(object sender, System.EventArgs e)
		{
			blnStateOfCheck = false;
		}

		
		//**************************************************************************              
		///    <Description>
		///	      Check data and call UpdateSOCancelCommit of BO class
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, March 3, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void  btnCancelCommitment_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ". btnCancelCommitment_Click()";
			blnHasError = true;
			try
			{
				dgrdData.UpdateData();
				ValidateData();	
				if (PCSMessageBox.Show(ErrorCode.MESSAGE_CANCELCOMIIT_AREYOURSURE, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
				{
					boCancelCommitment.CancelCommitment(dstCancelCommit.Tables[0],int.Parse(cboCCN.SelectedValue.ToString()));
					blnHasError = false;
					PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
					BindDataToGrid(voSOMaster.SaleOrderMasterID);
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				if (ex.CauseException != null)
				{
					try
					{
						Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
					}
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///       Close form event
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Friday, March 4, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnClose_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		//**************************************************************************              
		///    <Description>
		///       Check to throw question if user check but not save before close
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       true : if user has changed on form
		///       false: if else
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Friday, March 4, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private bool CheckBeforeExit()
		{
			if (enumAction != EnumAction.Default)
			{
				foreach (DataRow drow in dstCancelCommit.Tables[SO_CommitInventoryDetailTable.TABLE_NAME].Rows)
				{
					if (drow.RowState != DataRowState.Deleted)
					{
						if (drow[CANCEL].ToString() == TRUE)
						{
							return true;
						}
					}
				}
				return false;
			}
			return false;
		}

		//**************************************************************************              
		///    <Description>
		///       Close form
		///			check and throw question for user
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Friday, March 4, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void SOCancelCommitment_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			if (CheckBeforeExit())
			{
				DialogResult confirmDialog = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
				switch (confirmDialog)
				{
					case DialogResult.Yes:
						//Save before exit
						 btnCancelCommitment_Click( btnCancelCommitment, new EventArgs());
						if (blnHasError)
						{
							e.Cancel = true;
						}
						break;
					case DialogResult.No:
						break;
					case DialogResult.Cancel:
						e.Cancel = true;
						break;
				}
			}
		}


		private void txtSaleOrderCode_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.F4)
			{
				btnFindSaleOrder_Click(sender, new EventArgs());
			}
		}

		//**************************************************************************              
		///    <Description>
		///		 Change the backgroud and open the search form if need
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Tuesday, Mar 21, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void txtSaleOrderCode_Leave(object sender, System.EventArgs e)
		{
			string METHOD_NAME = THIS + ".txtSaleOrderCode_Leave()";
			OnLeaveControl(sender, e);
			if (!txtSaleOrderCode.Modified) return;
			if (txtSaleOrderCode.Text == string.Empty)
			{
				return;
			}
			try
			{
				DataRowView drwResult = null;
				Hashtable htbCriteria = new Hashtable();
				if (cboCCN.SelectedValue != null)
				{
					htbCriteria.Add(SO_SaleOrderMasterTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
				}
				else
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Warning);
					cboCCN.Focus();
					return;
				}
				
				drwResult = FormControlComponents.OpenSearchForm(v_SOCancelCommitment.VIEW_NAME , SO_SaleOrderMasterTable.CODE_FLD, txtSaleOrderCode.Text, htbCriteria, false);
				if (drwResult != null)
				{
					txtSaleOrderCode.Text = drwResult[SO_SaleOrderMasterTable.CODE_FLD].ToString();
					int intPartyID = 0, intLocID = 0;
					try
					{
						intPartyID = int.Parse(drwResult[SO_SaleOrderMasterTable.PARTYID_FLD].ToString());
					}
					catch{}
					try
					{
						intLocID = int.Parse(drwResult[SO_SaleOrderMasterTable.BUYINGLOCID_FLD].ToString());
					}
					catch{}
					GetInfors(intPartyID, intLocID);
					voSOMaster.SaleOrderMasterID = int.Parse(drwResult[SO_SaleOrderMasterTable.SALEORDERMASTERID_FLD].ToString());
				}
				else
				{
					txtSaleOrderCode.Focus();
				}
			}
			catch(PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch(Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		#region Change background when focus
		private void OnEnterControl(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ". OnEnterControl()";
			try
			{
				FormControlComponents.OnEnterControl(sender, e);
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void OnLeaveControl(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ". OnLeaveControl()";
			try
			{
				FormControlComponents.OnLeaveControl(sender, e);
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}
		#endregion

		private void SOCancelCommitment_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				this.Close();
			}
		}


		//**************************************************************************              
		///    <Description>
		///    List all cancelable
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Wednesday, Apr 27, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnSearch_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnSearch_Click()";
			try
			{
				if (FormControlComponents.CheckMandatory(txtSaleOrderCode))
				{
					PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
					BindDataToGrid(0);
					txtSaleOrderCode.Focus();
					txtSaleOrderCode.Select();
					return;
				}
				BindDataToGrid(voSOMaster.SaleOrderMasterID);
				enumAction = EnumAction.Edit;
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void dgrdData_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".dgrdData_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.Delete)
				{
					FormControlComponents.DeleteMultiRowsOnTrueDBGrid(dgrdData);
				}
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}
		private void txtQuote_Validating(object sender, CancelEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtQuote_Validating()";
			try
			{
				if (txtQuote.Modified && btnQuote.Enabled)
				{
					if (txtQuote.Text.Trim().Equals(string.Empty))
						return;
					else
					{
						DataRowView drvResult = FormControlComponents.OpenSearchForm(SO_CommitInventoryMasterTable.TABLE_NAME, SO_CommitInventoryMasterTable.COMMITMENTNO_FLD, txtQuote.Text.Trim(), null, false);
						if (drvResult != null)
						{
							txtQuote.Text = drvResult[SO_CommitInventoryMasterTable.COMMITMENTNO_FLD].ToString();
							txtQuote.Tag = Convert.ToInt32(drvResult[SO_CommitInventoryMasterTable.COMMITINVENTORYMASTERID_FLD]);
						}
						else
							e.Cancel = true;
					}
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
		}

		private void txtQuote_KeyDown(object sender, KeyEventArgs e)
		{
			const string METHOD_NAME = THIS + ".txtQuote_KeyDown()";
			try
			{
				if (e.KeyCode == Keys.F4)
					btnQuote_Click(null, null);
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
		}

		private void btnQuote_Click(object sender, EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnQuote_Click()";
			try
			{
				DataRowView drvResult = FormControlComponents.OpenSearchForm(SO_CommitInventoryMasterTable.TABLE_NAME, SO_CommitInventoryMasterTable.COMMITMENTNO_FLD, txtQuote.Text.Trim(), null, true);
				if (drvResult != null)
				{
					txtQuote.Text = drvResult[SO_CommitInventoryMasterTable.COMMITMENTNO_FLD].ToString();
					txtQuote.Tag = Convert.ToInt32(drvResult[SO_CommitInventoryMasterTable.COMMITINVENTORYMASTERID_FLD]);
				}
				else
					txtQuote.Focus();
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
		}

	}
}
